﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Security.Permissions;

namespace PIS.TechGrid.Gadgets.ChangeIP
{
    [Serializable]
    public class MyList <T> : List<T>, ISerializable
    {
        public MyList()
        {
        }

        public MyList(IEnumerable<T> list)
        {
            if (list != null)
            {
                this.AddRange(list);
            }
        }

        public T GetDefault()
        {
            if (this.Count > 0)
            {
                return this[0];
            }

            return default(T);
        }

        [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] 
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {

        }
    }
}
